Repository navigation
bugc: leave the jump past an inlined return out of the inlined body - #347
Merged
Merged
Conversation
At optimization levels 2 and 3, the jump from an inlined body to the caller's continuation runs after the inlined function's return, so it is the caller's code. It kept a transform: ["inline"] context, so a debugger that reads the transform put that jump in an inlined body that had already returned, with no function or call site to name.
Contributor
|
gnidan
added a commit
to ethdebug/argot-post-2026-10
that referenced
this pull request
Oct 6, 2026
The Inlining panel took its marker from the transform of the instruction about to run, while the call stack applies each instruction's context after it runs (contexts are postconditions). So the panel opened an inlined body one step before the call stack, and closed it one step before too. On the jump past sq's return, which bugc marks inline (ethdebug/format#347), it read "body of ?, inlined at line -1". Now the panel's marker comes from the call stack: a step is in an inlined body when its innermost frame is an inlined one, and the panel names that frame's function and call site. run.mjs checks that the two agree at every step, that neither reads "?" or "-1", and that sq's steps run from its inlined invoke to its inlined return.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At optimization levels 2 and 3, bugc replaces an inlined call's return with a jump to the caller's continuation. Since #341, the inlined function's
returncontext rides the body's last instruction, and that jump keeps the caller's source range, inline sites and variables. But it also kept atransform: ["inline"]context, though it runs after the return.ethdebug/format/program/context/transform says
"inline"marks an instruction that is part of an inlined function body, with the surrounding invoke/return contexts naming the callee. The jump is past the return, so no invoke/return surrounds it. A debugger that reads the transform then puts the jump in an inlined body that has already returned. In the blog's debugger demo (scores.bugat -O2, wheresqis inlined), the Inlining panel read "body of ?, inlined at line -1" on those steps, while the call stack, built from the invoke and return contexts, had no inlined frame.This removes the transform from that jump, and with it the
placementhelper that only that site used. A new test ininline-bracket.test.tschecks that every op with theinlinetransform sits between an inlined invoke and its return.